home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form Form1
- BackColor = &H00000000&
- BorderStyle = 0 'None
- Caption = "FireBall"
- ClientHeight = 4485
- ClientLeft = 0
- ClientTop = 0
- ClientWidth = 5850
- LinkTopic = "Form1"
- ScaleHeight = 4485
- ScaleWidth = 5850
- ShowInTaskbar = 0 'False
- StartUpPosition = 3 'Windows Default
- WindowState = 2 'Maximized
- Begin VB.Label Label1
- BackStyle = 0 'Transparent
- Caption = "Click to Exit"
- ForeColor = &H00FFFFFF&
- Height = 255
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 5175
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '***************************************************************************
- 'FireBall v1.0
- 'Author: Dustin Davis
- 'Bootleg Software Inc.
- 'http://www.warpnet.org/bsi
- 'This code is a VERY good, and EASY to follow program. If you properly
- 'read this code, you will learn very quickly how to do it yourself.
- 'also, you will learn how to draw and manipulate pixels. With that
- 'knowlage, you can make many awsome things, such as, demos, animations
- 'and so on. Please do not steal this code!
- '***************************************************************************
- 'Start the declarations
- 'Pixel location variables
- Dim X1 As Long
- Dim X2 As Long
- Dim X3 As Long
- Dim X4 As Long
- Dim X5 As Long
- Dim X6 As Long
- Dim X7 As Long
- Dim X8 As Long
- Dim Y1 As Long
- Dim Y2 As Long
- Dim Y3 As Long
- Dim Y4 As Long
- Dim Y5 As Long
- Dim Y6 As Long
- Dim Y7 As Long
- Dim Y8 As Long
- 'direction variable. 1&5=up, 2&6=down, 3&7=left, 4&8=right
- Dim Direction As Integer
- 'pixel tail locations. These are for erasing the tail!
- Dim Xx1(999) As Long
- Dim Yy1(999) As Long
- Dim Xx2(999) As Long
- Dim Yy2(999) As Long
- Dim Xx3(999) As Long
- Dim Yy3(999) As Long
- Dim Xx4(999) As Long
- Dim Yy4(999) As Long
- Dim Xx5(999) As Long
- Dim Yy5(999) As Long
- Dim Xx6(999) As Long
- Dim Yy6(999) As Long
- Dim Xx7(999) As Long
- Dim Yy7(999) As Long
- Dim Xx8(999) As Long
- Dim Yy8(999) As Long
- 'color variables
- Public tColor1 As Long 'this one will be set to red
- Public tColor2 As Long 'this one will be set to yellow
- Public bColor As Long 'this one will be set to black for the background
- Public iStop As Boolean 'stop variable
- Public Sub Start_Ants()
- 'this is the function that makes the magic happen!
- Dim i As Integer
- iStop = False
- 'set the begining pixels in the middle of the screen
- 'remeber, X1 and Y1 are the only ones that are important!
- X1 = Form1.Width / 2
- Y1 = Form1.Height / 2
- i = 0 'set the loop variable to 0
- Randomize
- DoEvents
- Direction = (Rnd * 8) 'randomizing direction
- Direction = ((Rnd * Direction) + (Rnd * Direction)) 'again so it doesnt favor one #
- 'check to see what direction its gonna go!
- If Direction = 1 Or Direction = 5 Then 'go up
- Y1 = Y1 - Direction 'Remember, X1 and Y1 are the most important.
- 'start offset of tail pixels
- X2 = X1 + 2
- Y2 = Y1 + 2
- X3 = X1 + 4
- Y3 = Y1 + 4
- X4 = X1 + 6
- Y4 = Y1 + 6
- X5 = X1 + 8
- Y5 = Y1 + 8
- X6 = X1 + 10
- Y6 = Y1 + 10
- X7 = X1 + 12
- Y7 = Y1 + 12
- X8 = X1 + 14
- Y8 = Y1 + 14
- 'put the pixels on the screen
- PSet (X1, Y1), tColor1
- PSet (X2, Y2), tColor2
- PSet (X3, Y3), tColor1
- PSet (X4, Y4), tColor2
- PSet (X5, Y5), tColor1
- PSet (X6, Y6), tColor2
- PSet (X7, Y7), tColor1
- PSet (X8, Y8), tColor2
- ElseIf Direction = 2 Or Direction = 6 Then 'go down
- Y1 = Y1 + Direction 'X1 and Y1 are the only ones you should change, offset the others
- 'start offset of tail pixels
- X2 = X1 + 2
- Y2 = Y1 + 2
- X3 = X1 + 4
- Y3 = Y1 + 4
- X4 = X1 + 6
- Y4 = Y1 + 6
- X5 = X1 + 8
- Y5 = Y1 + 8
- X6 = X1 + 10
- Y6 = Y1 + 10
- X7 = X1 + 12
- Y7 = Y1 + 12
- X8 = X1 + 14
- Y8 = Y1 + 14
- 'put pixels on the screen
- PSet (X1, Y1), tColor1
- PSet (X2, Y2), tColor2
- PSet (X3, Y3), tColor1
- PSet (X4, Y4), tColor2
- PSet (X5, Y5), tColor1
- PSet (X6, Y6), tColor2
- PSet (X7, Y7), tColor1
- PSet (X8, Y8), tColor2
- ElseIf Direction = 3 Or Direction = 7 Then 'go left
- X1 = X1 - Direction
- 'start offset of tail pixels
- X2 = X1 + 2
- Y2 = Y1 + 2
- X3 = X1 + 4
- Y3 = Y1 + 4
- X4 = X1 + 6
- Y4 = Y1 + 6
- X5 = X1 + 8
- Y5 = Y1 + 8
- X6 = X1 + 10
- Y6 = Y1 + 10
- X7 = X1 + 12
- Y7 = Y1 + 12
- X8 = X1 + 14
- Y8 = Y1 + 14
- 'show pixels
- PSet (X1, Y1), tColor1
- PSet (X2, Y2), tColor2
- PSet (X3, Y3), tColor1
- PSet (X4, Y4), tColor2
- PSet (X5, Y5), tColor1
- PSet (X6, Y6), tColor2
- PSet (X7, Y7), tColor1
- PSet (X8, Y8), tColor2
- ElseIf Direction = 4 Or Direction = 8 Then 'go right
- X1 = X1 + Direction
- 'start offset
- X2 = X1 + 2
- Y2 = Y1 + 2
- X3 = X1 + 4
- Y3 = Y1 + 4
- X4 = X1 + 6
- Y4 = Y1 + 6
- X5 = X1 + 8
- Y5 = Y1 + 8
- X6 = X1 + 10
- Y6 = Y1 + 10
- X7 = X1 + 12
- Y7 = Y1 + 12
- X8 = X1 + 14
- Y8 = Y1 + 14
- 'show pixels
- PSet (X1, Y1), tColor1
- PSet (X2, Y2), tColor2
- PSet (X3, Y3), tColor1
- PSet (X4, Y4), tColor2
- PSet (X5, Y5), tColor1
- PSet (X6, Y6), tColor2
- PSet (X7, Y7), tColor1
- PSet (X8, Y8), tColor2
- End If
- 'start of tail editing
- DoEvents
- If i < 999 Then
- i = i + 1
- End If
- 'start of saving tail pixel locations for erasing later
- Xx1(i) = X1
- Yy1(i) = Y1
- Xx2(i) = X2
- Yy2(i) = Y2
- Xx3(i) = X3
- Yy3(i) = Y3
- Xx4(i) = X4
- Yy4(i) = Y4
- Xx5(i) = X5
- Yy5(i) = Y5
- Xx6(i) = X6
- Yy6(i) = Y6
- Xx7(i) = X7
- Yy7(i) = Y7
- Xx8(i) = X8
- Yy8(i) = Y8
- If i >= 999 Then
- i = 0
- 'this will erase the last part of the tail that are stored in memory
- Do
- i = i + 1
- PSet (Xx1(i), Yy1(i)), bColor
- PSet (Xx2(i), Yy2(i)), bColor
- PSet (Xx3(i), Yy3(i)), bColor
- PSet (Xx4(i), Yy4(i)), bColor
- PSet (Xx5(i), Yy5(i)), bColor
- PSet (Xx6(i), Yy6(i)), bColor
- PSet (Xx7(i), Yy7(i)), bColor
- PSet (Xx8(i), Yy8(i)), bColor
- Loop Until i >= 999
- i = 0
- End If
- 'check to see if it has hit the walls or not, if so, then set location
- 'somewhere else
- If Y1 >= Form1.Height - 100 Then
- X1 = (Rnd * Form1.Width)
- Y1 = (Rnd * Form1.Height)
- ElseIf Y1 <= 10 Then
- X1 = (Rnd * Form1.Width)
- Y1 = (Rnd * Form1.Height)
- ElseIf X1 <= 10 Then
- X1 = (Rnd * Form1.Width)
- Y1 = (Rnd * Form1.Height)
- ElseIf X1 >= Form1.Width - 100 Then
- X1 = (Rnd * Form1.Width)
- Y1 = (Rnd * Form1.Height)
- End If
- 'end wall check
- Loop Until iStop = True
- Unload Me
- End Sub
- Private Sub Form_Activate()
- Call Start_Ants
- End Sub
- Private Sub Form_Click()
- iStop = True
- End Sub
- Private Sub Form_Load()
- bColor = 0 'background color
- tColor1 = 65535 'yellow
- tColor2 = 33023 'red
- Form1.BackColor = bColor 'set form background color
- End Sub
-